home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
kermit.columbia.edu
/
kermit.columbia.edu.tar
/
kermit.columbia.edu
/
newsgroups
/
misc.19970929-19971216
/
000342_news@newsmaster….columbia.edu _Sat Dec 6 11:16:04 1997.msg
< prev
next >
Wrap
Internet Message Format
|
1997-12-15
|
7KB
Return-Path: <news@newsmaster.cc.columbia.edu>
Received: from newsmaster.cc.columbia.edu (newsmaster.cc.columbia.edu [128.59.35.30])
by watsun.cc.columbia.edu (8.8.5/8.8.5) with ESMTP id LAA09956
for <kermit.misc@watsun.cc.columbia.edu>; Sat, 6 Dec 1997 11:16:04 -0500 (EST)
Received: (from news@localhost)
by newsmaster.cc.columbia.edu (8.8.5/8.8.5) id LAA01728
for kermit.misc@watsun; Sat, 6 Dec 1997 11:16:03 -0500 (EST)
Path: news.columbia.edu!watsun.cc.columbia.edu!fdc
From: fdc@watsun.cc.columbia.edu (Frank da Cruz)
Newsgroups: comp.protocols.kermit.misc
Subject: Re: set host name service broke 5A(190) to 6.0.192
Date: 6 Dec 1997 16:16:02 GMT
Organization: Columbia University
Lines: 115
Message-ID: <66bto2$eff$1@apakabar.cc.columbia.edu>
References: <669ptm$7c3$1@post.servtech.com>
NNTP-Posting-Host: watsun.cc.columbia.edu
Keywords: host telnet port service expect
Xref: news.columbia.edu comp.protocols.kermit.misc:8137
In article <669ptm$7c3$1@post.servtech.com>,
Dr. R. Chandra <rchandra@letter.com> wrote:
: I used to use "set host name service" in 5A(190), primarily in the
: following incantation:
:
: set host smtp.servtech.com smtp
:
: After building 6.0.192 and running the same script, the "service" part
: would always get forced to telnet. This, of course, broke things in a
: big way. Here may be some relevant configuration data:
:
: C-Kermit 6.0.192, 6 Sep 96, for Linux
: ...
:
This has never been reported before. Locally, connections of the form "set
host xxx smtp" work just fine, except to the host you have named above.
However, experimentation shows that even when this fails, it tends to work if
you make a different connection first, then close it, then try again to make
the connection that didn't work before.
: I hacked around this to get it to work, basically by creating my own
: global variable called tcpsvc...
:
I'm not sure there was a problem there. Debug logs show that C-Kermit does
not show any symptoms of forgetting about the service. Comparison of the
6.0 netopen() source code and the 6.1 code (currently in development, which
works) shows a few subtle differences which evidently do the trick. Of
course, anything is possible - but if there were a flagrant error, we
certainly would have heard about it before now.
In any case, we'll give the code a close look.
: BTW, I doubt this is related, but just in the interest of full
: disclosure: I made some other mods to the code to enable me to use
: Kermit as the dialer for PPP (pppd). This involved a few changes,
: mainly to ckutio.c. I set up a global flag which is initialized to
: false, and only gets set to true by encountering EXIT or QUIT. In the
: ttclos() routine, if this flag is not set, it returns without setting
: the speed to B0 (which would hang up...not particularly useful when
: PPP negotiations are in progress).
:
Well... Setting the speed to B0 is only one of many ways of hanging up.
Other ways include sending the hangup string to the modem, dropping DTR, etc,
and C-Kermit will do whatever is appropriate based on the platform, various
settings, etc. In UNIX, isn't it true that when a process exits, all of the
files it opened are automatically closed? And in that case, doesn't closing
of a terminal device usually involve dropping DTR, which, when a modem is
configured normally, causes it to hang up the phone?
: Thus, the line only gets hung up
: by "other forces" (such as the HUPCL bit :^). Additionally, the
: programs (scripts) that run when the IP layer goes up and the modem is
: to be hung up (ip-up script/program and "disconnect <program/script>"
: argument) manage the lockfiles, which enables cooperation between
: Kermit and pppd. Lastly, if Kermit discovers that the number in the
: lockfile is not its own PID, it prints a warning and does not attempt
: to remove (unlink(2)) the lockfile(s).
:
Lots of people want to make C-Kermit do their PPP or SLIP dialing, for
good reasons. But there is a better way to do it. Instead of having
Kermit open the terminal device, pass it the file descriptor of an already-
open device (this fits your description); then it won't try to open it or
to close it, and therefore it won't hang it up. There is an entry in the
(newly updated) Kermit FAQ about this:
27 HOW CAN I EXIT FROM C-KERMIT WITHOUT HANGING UP?
Many people want to be able to make a dialout connection with UNIX C-Kermit,
but then use some other software on the connection that C-Kermit made. For
example, they want to use C-Kermit as their SLIP or PPP dialer. But they
quickly find that when they exit from C-Kermit, that the connection is gone
before they can start the other application.
It is a fundamental property of UNIX (and VMS, and Windows 95 and NT, and most
other modern operating systems) that when a process exits, then every file that
was opened by that process is automatically closed by the operating system. In
most cases, closing a terminal device (such as a dialout serial port) hangs up
the modem (by turning off the DTR signal). There is nothing the process can do
about it.
However, many workarounds are possible. Here are just a few:
- If your C-Kermit version supports the REDIRECT command, use it to
start the desired application (e.g. "redirect pppd"). The REDIRECT
command runs the given application with its standard input and output
redirected to the communications channel opened by C-Kermit's most
recent SET LINE or SET HOST command.
- Tell C-Kermit to SET MODEM HANGUP-METHOD RS232, and then configure
your modem to ignore DTR (not recommended). "Using C-Kermit", 2nd
Ed., p.86.
- When opening the device first from another application, feed the file
descriptor for the device to C-Kermit using the "-l" (lowercase
letter L) command-line option followed by the numeric file
descriptor, e.g. "kermit -l 6". Then Kermit will not attempt to
open the device, nor to change its characteristics, nor to close it
when done, and when Kermit exits, it will still be available to the
invoking process. "Using C-Kermit", 2nd Ed., p.469.
- When opening the device with C-Kermit, find out the file descriptor
of the open device (it is given by C-Kermit's \v(ttyfd) variable) and
then run ("!") your other program from the C-Kermit prompt, feeding
it the file descriptor, e.g. through shell redirection or a command
line option (the method depends on the other program, the
capabilities of the shell, etc). "Using C-Kermit", 2nd Ed., p.356
- In UNIX, after Kermit makes the connection, type "show comm" to find
out the filename of the lock file. Then suspend Kermit, delete the
lock file, then start the other program and tell it to open the same
tty device.
Thanks for the report.
- Frank